<template>
  <div>
      父组件
      <input type="text" v-model="num">
    <Child @sendMsg="getMsg" :num="getNum"/>
    <p>{{info}}</p>
  </div>
</template>

<script>
import Child from './child'
export default {
  name: "parent",
  components:{
      Child
  },
  data() {
    return {
      info:"",
      num:10
    };
  },
  computed:{
      getNum(){
          return this.num -0
      }
  },
  methods:{
      getMsg(data){
          this.info=data
          //console.log(data)
      }
  }
};
</script>

<style scoped>

</style>